package bma.common.langutil.ai.stack;

public class AIStackPrint<RESP_TYPE> extends AIStackAbstract<RESP_TYPE> {

	private String name;

	public AIStackPrint() {
		super();
	}

	public AIStackPrint(String name) {
		super();
		this.name = name;
	}

	@Override
	public boolean success(RESP_TYPE result) {
		if (name != null) {
			System.out.print("AIStack['" + name + "'] success => ");
		}
		System.out.println(result);
		return true;
	}

	@Override
	public boolean failure(Throwable t) {
		if (name != null) {
			System.out.println("AIStack['" + name + "'] fail");
		}
		t.printStackTrace(System.out);
		return true;
	}

	@Override
	public AIStack<?> getParent() {
		return null;
	}

}
